package com.jetshine.gis.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jetshine.gis.common.base.AjaxResult;
import com.jetshine.gis.common.base.BaseController;
import com.jetshine.gis.model.auto.Coordinates;

@Controller
@RequestMapping("api")
public class ApiController extends BaseController{
	
	@PostMapping("add")
	@ResponseBody
	public AjaxResult add(Coordinates record) {
		 int i= coordinatesService.insertSelective(record);
		 if(i>0) {
			return AjaxResult.success();
		 }else {
			 return AjaxResult.error();
		 }
	}
	
	
	@GetMapping("getgj")
	@ResponseBody
	public Object getgj(String userid,String startdate,String enddate) {
		List<Coordinates> list=coordinatesService.getuserDate(userid, startdate,enddate);
		if(list!=null&&list.size()>0) {
			return AjaxResult.successData(200, list);
		}
		return AjaxResult.successData(200, 0);
	}
	
	
	
	
	
	
}
